package com.office.service.impl;

import com.office.bean.TDepart;
import com.office.mapper.Departmapper;
import com.office.service.DepartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class DepartServiceimpl implements DepartService {
    @Autowired
    Departmapper departmapper;
    @Override
    public int addDepart(TDepart depart) {
        return departmapper.adddepart(depart);
    }

    @Override
    public long findallcount() {
        return departmapper.finfallpagecount();
    }

    @Override
    public List<TDepart> findpagecount(Map<String, Object> map) {
        return departmapper.finddepartbypage(map);
    }

    @Override
    public boolean delectdepart(int id) {
        boolean delectdepart = departmapper.delectdepart(id);
        return delectdepart;
    }

    @Override
    public TDepart findDepartByid(int id) {
        return departmapper.findDepartByid(id);
    }

    @Override
    public int updateDepart(TDepart tDepart) {
        return departmapper.updateDepart(tDepart);
    }
}
